package cn.gson.springboot.model.dao;

import cn.gson.springboot.model.pojos.StorageDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface StorageDetailDao extends CrudRepository<StorageDetail,Integer> {
    //根据StoId删除详单
    @Query("delete from StorageDetail s where s.storageByStorageId.storageId = :storageId")
    @Modifying
    public void deleteByStoId(@Param("storageId") int storageId);
}
